<template>
  <el-carousel height="700px">
    <el-carousel-item v-for="item in images" :key="item.sliderId">
      <img :src="item.imageUrl" alt="轮播图" />
    </el-carousel-item>
  </el-carousel>
</template>

<script>
import API from "../../api/API";
export default {
  data() {
    return {
      images: [],
    };
  },
  mounted() {
    API.getSliders()
      .then((response) => {
        this.images = response.data.data;
        console.log("create");
        console.log(this.images[0].imageUrl);
      })
      .catch((error) => {
        console.error("Error fetching categories:", error);
      });
  },
  methods: {},
};
</script>

<style lang="less" scoped></style>
